﻿<Window
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:local="clr-namespace:XiaLastorm.Sharpshooter.Client"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="XiaLastorm.Sharpshooter.Client.MainWindow"
		Title="Sharpshooter" Height="500" Width="250"
		WindowStyle="None"
		AllowsTransparency="True"
		MouseLeftButtonDown="Window_MouseLeftButtonDown">
	
	<Window.Resources>

		<Storyboard x:Key="TbPasswordAppear">
			<ThicknessAnimationUsingKeyFrames Storyboard.TargetName="TbPassword" Storyboard.TargetProperty="Margin">
				<LinearThicknessKeyFrame KeyTime="0:0:0.5" Value="7,100,7,7"/>
			</ThicknessAnimationUsingKeyFrames>
			<DoubleAnimation Storyboard.TargetName="TbPassword" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5" />
		</Storyboard>

		<Storyboard x:Key="TbPasswordDisappear">
			<ThicknessAnimationUsingKeyFrames Storyboard.TargetName="TbPassword" Storyboard.TargetProperty="Margin">
				<LinearThicknessKeyFrame KeyTime="0:0:1" Value="7,7,7,7"/>
			</ThicknessAnimationUsingKeyFrames>
			<DoubleAnimation Storyboard.TargetName="TbPassword" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:1" />
		</Storyboard>

		<Storyboard x:Key="PanelLoginAppear">
			<ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PanelNormal" Storyboard.TargetProperty="Margin" >
				<LinearThicknessKeyFrame KeyTime="0:0:0.2" Value="0,0,0,0"/>
			</ThicknessAnimationUsingKeyFrames>
			<ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PanelLogIn" Storyboard.TargetProperty="Margin" >
				<LinearThicknessKeyFrame KeyTime="0:0:0.2" Value="-250,0,250,0"/>
			</ThicknessAnimationUsingKeyFrames>
		</Storyboard>
		
		<Storyboard x:Key="PanelLoginDisappear">
			<ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PanelNormal" Storyboard.TargetProperty="Margin" >
				<LinearThicknessKeyFrame KeyTime="0:0:0.2" Value="250,0,-250,0"/>
			</ThicknessAnimationUsingKeyFrames>
			<ThicknessAnimationUsingKeyFrames Storyboard.TargetName="PanelLogIn" Storyboard.TargetProperty="Margin" >
				<LinearThicknessKeyFrame KeyTime="0:0:0.2" Value="0,0,0,0"/>
			</ThicknessAnimationUsingKeyFrames>
		</Storyboard>

	</Window.Resources>
	
	<Window.Background>
		<LinearGradientBrush EndPoint="0,0" StartPoint="1,1">
			<GradientStop Color="#FF59A0FF" Offset="0" />
			<GradientStop Color="#FFEEF8FF" Offset="1" />
			<GradientStop Color="#FFAED2FF" Offset="0.35"/>
		</LinearGradientBrush>
	</Window.Background>
	<Grid>
	
		<Grid x:Name="PanelLogIn">
			<StackPanel Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center">
				
				<Grid>
					<!--
					<Grid.RowDefinitions>
						<RowDefinition/>
						<RowDefinition/>
						<RowDefinition/>
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition/>
						<ColumnDefinition Width="100"/>
					</Grid.ColumnDefinitions>
					<Label Content="服务器"/>
					<TextBox Grid.Column="1" x:Name="TbServerHost" Text="localhost"/>
					<Label Grid.Row="1" Content="用户名"/>
					<TextBox Grid.Row="1" Grid.Column="1" x:Name="TbUsername"/>
					<Label Grid.Row="2" Content="密码"/>
					<TbPassword Grid.Row="2" Grid.Column="1" x:Name="TbPassword"/>
					-->
					<TextBox x:Name="TbServerHost" Text="localhost" Visibility="Hidden"/>
					<PasswordBox x:Name="TbPassword" Style="{StaticResource TbPassword}"/>
					<TextBox x:Name="TbUsername" PreviewMouseUp="TbUsername_PreviewMouseUp" Style="{StaticResource TbUsername}" ></TextBox>
				</Grid>
				<Button x:Name="BtnLogIn" Style="{StaticResource ButtonStyle}" Content="Login" IsDefault="True"/>
			</StackPanel>
		</Grid>
		<DockPanel x:Name="PanelNormal" Margin="250,0,-250,0">
			<DockPanel DockPanel.Dock="Top">
				<Border DockPanel.Dock="Bottom" Height="5" Margin="5,5,5,0" >
					<Border.Background>
						<RadialGradientBrush>
							<GradientStop Color="#FF7ECDFF" />
							<GradientStop Offset="1" />
							<GradientStop Color="#BF9DD9FF" Offset="0.717" />
						</RadialGradientBrush>
					</Border.Background>
				</Border>
				<Border DockPanel.Dock="Left" Width="50" Height="50" Margin="7,7,0,0" BorderThickness="2" BorderBrush="#FFAED2FF">
					<Image Source="face2s.jpg" />
				</Border>
				<StackPanel Margin="5,7,7,0">
					<TextBlock x:Name="TBlockUsername" />
					<TextBlock>太爽了！</TextBlock>
					<TextBlock>VIP1</TextBlock>
				</StackPanel>
			</DockPanel>
			<Grid DockPanel.Dock="Bottom">
				<Button x:Name="BtnLogOut" Style="{StaticResource ButtonStyle}">注销</Button>
			</Grid>
			<ListBox x:Name="LbFriends" Margin="7" BorderBrush="Transparent">
				<ListBox.Background>
					<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
						<GradientStop Color="#FFEEF8FF" Offset="1" />
						<GradientStop Color="#FFAED2FF" Offset="0.35" />
					</LinearGradientBrush>
				</ListBox.Background>
				<ListBox.ItemsPanel>
					<ItemsPanelTemplate>
						<WrapPanel />
					</ItemsPanelTemplate>
				</ListBox.ItemsPanel>
				<ListBox.ItemContainerStyle>
					<Style TargetType="{x:Type ListBoxItem}">
						<Setter Property="Template">
							<Setter.Value>
								<ControlTemplate TargetType="{x:Type ListBoxItem}">
									<Border Margin="5" Padding="2" BorderBrush="#d7eaff" MinWidth="50" MinHeight="50" BorderThickness="2" Background="#FFA9D5F7">
										<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
									</Border>
								</ControlTemplate>
							</Setter.Value>
						</Setter>
					</Style>
				</ListBox.ItemContainerStyle>
			</ListBox>
		</DockPanel>
		<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
			<Button Style="{StaticResource MiniButtonStyle}" Click="Button_Click_2"  HorizontalAlignment="Right" VerticalAlignment="Top" Width="15" Height="15" Margin="5"/>
			<Button Style="{StaticResource CloseButtonStyle}" Click="Button_Click" HorizontalAlignment="Right" VerticalAlignment="Top" Width="15" Height="15" Margin="5"/>
		</StackPanel>
	</Grid>
</Window>
